pub fn convert_base(num_str: &str, to_base: u32) -> String {
    // Parse the number and its original base
    if let Some((value_str, from_base_str)) = num_str.split_once('(') {
        let from_base = from_base_str.trim_end_matches(')').parse::<u32>().unwrap();

        // Convert the value from the original base to a decimal integer
        let decimal_value = u32::from_str_radix(value_str, from_base).unwrap();

        // Convert the decimal integer to the desired base
        return match to_base {
            2..=36 => {
                let mut result = String::new();
                let mut value = decimal_value;
                while value > 0 {
                    let digit = (value % to_base) as u8;
                    result.push(if digit < 10 {
                        (b'0' + digit) as char
                    } else {
                        (b'a' + digit - 10) as char
                    });
                    value /= to_base;
                }
                result.chars().rev().collect()
            }
            _ => panic!("Invalid base: {}", to_base),
        };
    }
    panic!("Invalid input: {}", num_str);
}
